<?php
namespace tp6test;

use PHPUnit\Framework\TestCase;
use think\facade\Session;

abstract class FrameworkTestCase extends TestCase {

    use AssertionsTrait, CrawlerTrait;

    /**
     * 基础路径
     * @var string
     */
    protected $baseUrl = '';
    
    /**
     * session设置
     * @param array $data
     * @return $this
     */
    public function withSession(array $data)
    {
        foreach ($data as $key => $value) {
            Session::set($key, $value);
        }
        return $this;
    }

    /**
     * 清空session数据
     * @return void
     */
    public function clearSession()
    {
        Session::clear();
    }
}
